
import Vue from 'vue';
import store from '../store/index.js';

import {roleArry} from './arry.js';

// 部门数组
export function getDepartment() {
  return new Promise((resolve, reject) => {
    Vue.prototype.axios.post("/user/department").then(res => {
      store.commit('ADD_DEPARTMENT',res)
      resolve(res)
    }).catch(error => {
    })
  })
}

export function roleId(id) {
    var arr= roleArry.filter(item=> item.id==id);
    if(arr.length){
      return arr[0].name;
    }
}


Vue.prototype.$roleId=roleId;
